package com.kim.rssreader.utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

public class ReadTXTUtil {
	

			InputStream inputStream = context.getResources().openRawResource(
			R.raw.citycode);
			List<String> codelist = ReadTXTUtil.inputstream2string(inputStream);

	
	public static List<String> inputstream2string(InputStream inputStream) {  
		List<String> codelist = new ArrayList<String>();
	    InputStreamReader inputStreamReader = null;  
	    try {  
	        inputStreamReader = new InputStreamReader(inputStream, "utf-8");  
	    } catch (UnsupportedEncodingException e1) {  
	        e1.printStackTrace();  
	    }  
	    BufferedReader reader = new BufferedReader(inputStreamReader);  
	    StringBuffer sb = new StringBuffer("");  
	    String line;  
	    try {  
	        while ((line = reader.readLine()) != null) {  
	        	codelist.add(line);
	        }  
	    } catch (IOException e) {  
	        e.printStackTrace();  
	    }  
	    return codelist;
	} 

}
